<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form rendered="#{loginBacking.editSystemUser}">
                <p:panel header="Personal Details">
                <h:panelGrid columns="2">
                    <h:outputText value="User Account ID:"/>
                    <h:outputText value="#{contactEntityController.selected.person}" title="#{bundle.ViewContactEntityTitle_person}"/>
                                           
                    <h:outputLabel value="Username: " for="name" />    
                    <h:outputText value="#{systemUserEntityController.selected.name}" title="#{bundle.EditSystemUserEntityTitle_name}" />
                    
                    <h:outputLabel value="Title: " for="title" />
                    <h:selectOneMenu id="title" value="#{systemUserEntityController.selected.title}" title="#{bundle.CreateSystemUserEntityTitle_title}" >
                        <f:selectItems value="#{systemUserEntityController.userTitles}"/>
                    </h:selectOneMenu>
                    
                    <h:outputLabel value="First Name: " for="firstName" />
                    <h:inputText id="firstName" value="#{systemUserEntityController.selected.firstName}" title="#{bundle.EditSystemUserEntityTitle_firstName}" />
                    
                    <h:outputLabel value="Last Name: " for="lastName" />
                    <h:inputText id="lastName" value="#{systemUserEntityController.selected.lastName}" title="#{bundle.EditSystemUserEntityTitle_lastName}" />  
                    
                    <h:outputLabel value="Department: " for="department" />
                    <h:selectOneMenu id="department" value="#{systemUserEntityController.selected.department}" title="#{bundle.EditSystemUserEntityTitle_department}" >
                        <f:selectItems value="#{departmentEntityController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                </p:panel>
                <br />
                
                <p:panel header="Contact Information">
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateContactEntityLabel_contactNumber}" for="contactNumber" />
                    <h:inputText id="contactNumber" value="#{systemUserEntityController.selected.contact.contactNumber}" title="#{bundle.CreateContactEntityTitle_contactNumber}" />
                    <h:outputLabel value="#{bundle.CreateContactEntityLabel_email}" for="email" />
                    <h:inputText id="email" value="#{systemUserEntityController.selected.contact.email}" title="#{bundle.CreateContactEntityTitle_email}" />
                </h:panelGrid>
                </p:panel>
                <br />
                
                <ui:include src="/entities/addressEntity/EditAddress.xhtml"/>
                <br />
                <h:commandLink action="#{systemUserEntityController.update}" value="#{bundle.EditSystemUserEntitySaveLink}"/>
                <h:outputText value="  " />
                <h:commandLink action="View" value="Cancel"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
